/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-07 14:44:46
 * Copyright (c) 2015- joysuch-版权所有
 */

package com.joysuch.wwyt.bp.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "WWYT_BP_MAIN_MATERIAL")
@SQLDelete(sql = "update WWYT_BP_MAIN_MATERIAL set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BP_MAIN_MATERIAL set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpMainMaterial implements java.io.Serializable {

    //columns START
    //ID
    private Long id;
    //类型
    private String type;
    //编号
    private String code;
    //品名
    private String chemName;
    //CAS号
    private String chemCas;
    //危化品目录序号
    private String chemCategory;
    //危化品ID
    private Long chemId;
    //危险性类别
    private String chemDangerType;
    //物质形态
    private Long sustanceFormId;
    //年消耗量
    private String yearlyCost;
    //年消耗量计量单位
    private String yearlyCostUnit;
    //最大储存量
    private String maxStorage;
    //最大储存量计量单位
    private String maxStorageUnit;
    //储存场所ID（从collection中选）
    private Long storePlaceId;
    //是否属于高危存储设施
    private String isDangerousStorePlace;
    //重大危险源ID
    private Long majorHazardId;
    //危险化学品重大危险源等级
    private Integer majorHazardRiskLevel;
    //工艺流程ID
    private Long manufatureTechId;
    //是否属于重点监管危险化工工艺高危工艺
    private String isMainRegulatoryHchTech;
    //重点监管危险化工工艺
    private String mainRegulatoryTech;
    //是否高危化学品
    private String isDangerousChem;
    //是否剧毒化学品
    private String isToxicChem;
    //是否重点监管危险化学品
    private String isMainRegulatoryHch;
    //安全措施
    private String safetyMethod;
    //应急处置措施
    private String emergencyMethod;
    //是否易制毒
    private String isEasyMakeDrug;
    //是否易制爆
    private String isEasyExplode;
    //创建人
    private Long createBy;
    //创建时间
    private java.util.Date createTime;
    //更新人
    private Long updateBy;
    //更新时间
    private java.util.Date updateTime;
    //删除标记
    private String deleteFlag;
    //组织机构代码
    private String orgCode;
    //租户
    private Long tenentId;

    //存储装置
    private String storageDevice;
    //存储方式
    private String storageType;
    //实际储量
    private String actualStorge;
    //实际储量计量单位
    private String actualStorgeUnit;
    //年生产力
    private String yearProduction;
    //年生产力计量单位
    private String yearProductionUnit;
    //是否特别管控危险化学品
    private String isSpecialUnderControlChem;
    //是否为危化品
    private String isHazardousChemicals;
    //columns END

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }


    @Column(name = "TYPE", length = 5)
    public String getType() {
        return this.type;
    }

    public void setType(String value) {
        this.type = value;
    }


    @Column(name = "CODE")
    public String getCode() {
        return this.code;
    }

    public void setCode(String value) {
        this.code = value;
    }


    @Column(name = "CHEM_NAME", length = 50)
    public String getChemName() {
        return this.chemName;
    }

    public void setChemName(String value) {
        this.chemName = value;
    }


    @Column(name = "CHEM_CAS", length = 10)
    public String getChemCas() {
        return this.chemCas;
    }

    public void setChemCas(String value) {
        this.chemCas = value;
    }


    @Column(name = "CHEM_CATEGORY", length = 50)
    public String getChemCategory() {
        return this.chemCategory;
    }

    public void setChemCategory(String value) {
        this.chemCategory = value;
    }


    @Column(name = "CHEM_ID")
    public Long getChemId() {
        return this.chemId;
    }

    public void setChemId(Long value) {
        this.chemId = value;
    }


    @Column(name = "CHEM_DANGER_TYPE", length = 50)
    public String getChemDangerType() {
        return this.chemDangerType;
    }

    public void setChemDangerType(String value) {
        this.chemDangerType = value;
    }


    @Column(name = "SUSTANCE_FORM_ID")
    public Long getSustanceFormId() {
        return this.sustanceFormId;
    }

    public void setSustanceFormId(Long value) {
        this.sustanceFormId = value;
    }


    @Column(name = "YEARLY_COST")
    public String getYearlyCost() {
        return this.yearlyCost;
    }

    public void setYearlyCost(String value) {
        this.yearlyCost = value;
    }


    @Column(name = "YEARLY_COST_UNIT", length = 10)
    public String getYearlyCostUnit() {
        return this.yearlyCostUnit;
    }

    public void setYearlyCostUnit(String value) {
        this.yearlyCostUnit = value;
    }


    @Column(name = "MAX_STORAGE")
    public String getMaxStorage() {
        return this.maxStorage;
    }

    public void setMaxStorage(String value) {
        this.maxStorage = value;
    }


    @Column(name = "MAX_STORAGE_UNIT", length = 10)
    public String getMaxStorageUnit() {
        return this.maxStorageUnit;
    }

    public void setMaxStorageUnit(String value) {
        this.maxStorageUnit = value;
    }


    @Column(name = "STORE_PLACE_ID")
    public Long getStorePlaceId() {
        return this.storePlaceId;
    }

    public void setStorePlaceId(Long value) {
        this.storePlaceId = value;
    }


    @Column(name = "IS_DANGEROUS_STORE_PLACE", length = 2)
    public String getIsDangerousStorePlace() {
        return this.isDangerousStorePlace;
    }

    public void setIsDangerousStorePlace(String value) {
        this.isDangerousStorePlace = value;
    }


    @Column(name = "MAJOR_HAZARD_ID")
    public Long getMajorHazardId() {
        return this.majorHazardId;
    }

    public void setMajorHazardId(Long value) {
        this.majorHazardId = value;
    }


    @Column(name = "MAJOR_HAZARD_RISK_LEVEL")
    public Integer getMajorHazardRiskLevel() {
        return this.majorHazardRiskLevel;
    }

    public void setMajorHazardRiskLevel(Integer value) {
        this.majorHazardRiskLevel = value;
    }


    @Column(name = "MANUFATURE_TECH_ID")
    public Long getManufatureTechId() {
        return this.manufatureTechId;
    }

    public void setManufatureTechId(Long value) {
        this.manufatureTechId = value;
    }


    @Column(name = "IS_MAIN_REGULATORY_HCH_TECH", length = 2)
    public String getIsMainRegulatoryHchTech() {
        return this.isMainRegulatoryHchTech;
    }

    public void setIsMainRegulatoryHchTech(String value) {
        this.isMainRegulatoryHchTech = value;
    }


    @Column(name = "MAIN_REGULATORY_TECH", length = 100)
    public String getMainRegulatoryTech() {
        return this.mainRegulatoryTech;
    }

    public void setMainRegulatoryTech(String value) {
        this.mainRegulatoryTech = value;
    }


    @Column(name = "IS_DANGEROUS_CHEM", length = 2)
    public String getIsDangerousChem() {
        return this.isDangerousChem;
    }

    public void setIsDangerousChem(String value) {
        this.isDangerousChem = value;
    }


    @Column(name = "IS_TOXIC_CHEM", length = 2)
    public String getIsToxicChem() {
        return this.isToxicChem;
    }

    public void setIsToxicChem(String value) {
        this.isToxicChem = value;
    }


    @Column(name = "IS_MAIN_REGULATORY_HCH", length = 2)
    public String getIsMainRegulatoryHch() {
        return this.isMainRegulatoryHch;
    }

    public void setIsMainRegulatoryHch(String value) {
        this.isMainRegulatoryHch = value;
    }


    @Column(name = "SAFETY_METHOD", length = 500)
    public String getSafetyMethod() {
        return this.safetyMethod;
    }

    public void setSafetyMethod(String value) {
        this.safetyMethod = value;
    }


    @Column(name = "EMERGENCY_METHOD", length = 500)
    public String getEmergencyMethod() {
        return this.emergencyMethod;
    }

    public void setEmergencyMethod(String value) {
        this.emergencyMethod = value;
    }


    @Column(name = "IS_EASY_MAKE_DRUG", length = 2)
    public String getIsEasyMakeDrug() {
        return this.isEasyMakeDrug;
    }

    public void setIsEasyMakeDrug(String value) {
        this.isEasyMakeDrug = value;
    }


    @Column(name = "IS_EASY_EXPLODE", length = 2)
    public String getIsEasyExplode() {
        return this.isEasyExplode;
    }

    public void setIsEasyExplode(String value) {
        this.isEasyExplode = value;
    }


    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(Long value) {
        this.createBy = value;
    }


    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }


    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }


    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }


    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }


    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }


    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    @Column(name = "STORAGE_DEVICE")
    public String getStorageDevice() {
        return storageDevice;
    }

    public void setStorageDevice(String storageDevice) {
        this.storageDevice = storageDevice;
    }

    @Column(name = "STORAGE_TYPE")
    public String getStorageType() {
        return storageType;
    }

    public void setStorageType(String storageType) {
        this.storageType = storageType;
    }

    @Column(name = "ACTUAL_STORAGE")
    public String getActualStorge() {
        return actualStorge;
    }

    public void setActualStorge(String actualStorge) {
        this.actualStorge = actualStorge;
    }

    @Column(name = "ACTUAL_STORAGE_UNIT", length = 10)
    public String getActualStorgeUnit() {
        return actualStorgeUnit;
    }

    public void setActualStorgeUnit(String actualStorgeUnit) {
        this.actualStorgeUnit = actualStorgeUnit;
    }

    @Column(name = "YEAR_PRODUCTION")
    public String getYearProduction() {
        return yearProduction;
    }

    public void setYearProduction(String yearProduction) {
        this.yearProduction = yearProduction;
    }

    @Column(name = "YEAR_PRODUCTION_UNIT")
    public String getYearProductionUnit() {
        return yearProductionUnit;
    }

    public void setYearProductionUnit(String yearProductionUnit) {
        this.yearProductionUnit = yearProductionUnit;
    }

    @Column(name = "IS_SPECIAL_UNDER_CONTROL_CHEM", length = 2)
    public String getIsSpecialUnderControlChem() {
        return isSpecialUnderControlChem;
    }

    public void setIsSpecialUnderControlChem(String isSpecialUnderControlChem) {
        this.isSpecialUnderControlChem = isSpecialUnderControlChem;
    }

    @Column(name = "IS_HAZARDOUS_CHEMICALS", length = 2)
    public String getIsHazardousChemicals() {
        return isHazardousChemicals;
    }

    public void setIsHazardousChemicals(String isHazardousChemicals) {
        this.isHazardousChemicals = isHazardousChemicals;
    }

    @Override
    public String toString() {
        return "BpMainMaterial{" +
                "id=" + id +
                ", type='" + type + '\'' +
                ", code='" + code + '\'' +
                ", chemName='" + chemName + '\'' +
                ", chemCas='" + chemCas + '\'' +
                ", chemCategory='" + chemCategory + '\'' +
                ", chemId=" + chemId +
                ", chemDangerType='" + chemDangerType + '\'' +
                ", sustanceFormId=" + sustanceFormId +
                ", yearlyCost=" + yearlyCost +
                ", yearlyCostUnit='" + yearlyCostUnit + '\'' +
                ", maxStorage=" + maxStorage +
                ", maxStorageUnit='" + maxStorageUnit + '\'' +
                ", storePlaceId=" + storePlaceId +
                ", isDangerousStorePlace='" + isDangerousStorePlace + '\'' +
                ", majorHazardId=" + majorHazardId +
                ", majorHazardRiskLevel=" + majorHazardRiskLevel +
                ", manufatureTechId=" + manufatureTechId +
                ", isMainRegulatoryHchTech='" + isMainRegulatoryHchTech + '\'' +
                ", mainRegulatoryTech='" + mainRegulatoryTech + '\'' +
                ", isDangerousChem='" + isDangerousChem + '\'' +
                ", isToxicChem='" + isToxicChem + '\'' +
                ", isMainRegulatoryHch='" + isMainRegulatoryHch + '\'' +
                ", safetyMethod='" + safetyMethod + '\'' +
                ", emergencyMethod='" + emergencyMethod + '\'' +
                ", isEasyMakeDrug='" + isEasyMakeDrug + '\'' +
                ", isEasyExplode='" + isEasyExplode + '\'' +
                ", createBy=" + createBy +
                ", createTime=" + createTime +
                ", updateBy=" + updateBy +
                ", updateTime=" + updateTime +
                ", deleteFlag='" + deleteFlag + '\'' +
                ", orgCode='" + orgCode + '\'' +
                ", tenentId=" + tenentId +
                ", storageDevice='" + storageDevice + '\'' +
                ", storageType='" + storageType + '\'' +
                ", actualStorge=" + actualStorge +
                ", actualStorgeUnit='" + actualStorgeUnit + '\'' +
                ", yearProduction=" + yearProduction +
                ", yearProductionUnit='" + yearProductionUnit + '\'' +
                ", isSpecialUnderControlChem='" + isSpecialUnderControlChem + '\'' +
                ", isHazardousChemicals='" + isHazardousChemicals + '\'' +
                '}';
    }

    public int hashCode() {
        return new HashCodeBuilder()
                .append(getId())
                .toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpMainMaterial == false) return false;
        if (this == obj) return true;
        BpMainMaterial other = (BpMainMaterial) obj;
        return new EqualsBuilder()
                .append(getId(), other.getId())
                .isEquals();
    }
}

